#!/usr/bin/python3

var1 = 100
if var1:
    print("1 - if 表达式条件为 true")
    print(var1)

var2 = 0
if var2:
    print("2 - if 表达式条件为 true")
    print(var2)
print("Good bye!")

# !/usr/bin/python3

# age = int(input("请输入你家狗狗的年龄: "))
# print("")
# if age <= 0:
#     print("你是在逗我吧!")
# elif age == 1:
#     print("相当于 14 岁的人。")
# elif age == 2:
#     print("相当于 22 岁的人。")
# elif age > 2:
#     human = 22 + (age - 2) * 5
#     print("对应人类年龄: ", human)

### 退出提示
# input("点击 enter 键退出")


# !/usr/bin/env python3

n = 100

sum = 0
counter = 1
while counter <= n:
    sum = sum + counter
    counter += 1

print("1 到 %d 之和为: %d" % (n, sum))

a = 100;
b = 1;
while a > b:
    b = b + 1;

print(b)

# !/usr/bin/python3

count = 0
while count < 5:
    print(count, " 小于 5")
    count = count + 1
else:
    print(count, " 大于或等于 5")

languages = ["C", "C++", "Perl", "Python"]
for x in languages:
    print(x)
for i in range(5, 9):
    print(i)

ss = int("1")
if ss:
    print("if==" + str(ss))
else:
    print("esle==" + str(ss))
username = "ss"
password = "ss1"


def test():
    login = int(ss)
    if login:
        return username and password
    else:
        return False


print(test())


def str_to_boolean(s):
    if int(s) > 0:
        return True
    else:
        return False


print(str_to_boolean("0"))
print(str_to_boolean("1"))
print(str_to_boolean("2"))
